USE [master]
GO

IF DB_ID (N'Test') IS NOT NULL
DROP DATABASE Test;
GO

DECLARE @data_path nvarchar(256);
SET @data_path = (SELECT SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1)
                  FROM master.sys.master_files
                  WHERE database_id = 1 AND file_id = 1);

EXECUTE ('CREATE DATABASE Test
ON 
( NAME = Test_dat,
    FILENAME = '''+ @data_path + 'Testdat.mdf'',
    SIZE = 10,
    MAXSIZE = UNLIMITED,
    FILEGROWTH = 1024KB )
LOG ON
( NAME = Test_log,
    FILENAME = '''+ @data_path + 'Testlog.ldf'',
    SIZE = 5MB,
    MAXSIZE = 2048GB,
    FILEGROWTH = 10% )
COLLATE Cyrillic_General_CI_AS'
);
GO